#include "Timer.h"

Timer::Timer()
	: Last(0)
	, Current(0)
	, Elapsed(0)
	, Timeout(0)
{

}

void Timer::Begin( long TimeoutMS )
{
	Timeout = TimeoutMS;
	Current = clock();
}

long Timer::ElapsedTime( void )
{
	Last = Current;
	Current = clock();
	Elapsed = Current - Last;
	return Elapsed;
}

bool Timer::IsTimeout( void )
{
	ElapsedTime();
	return (Elapsed>Timeout) ? true : false;
}